import type { DrawerProps as NDrawerProps, ModalProps as NModalProps } from 'naive-ui'
import type { VNodeChild } from 'vue'
import type { NvFormMode } from '@/form/types'
import type { BaseComponentProps } from '@/types'

interface BaseContainerProps extends BaseComponentProps {
  title?: () => VNodeChild
  height?: number | string
  width?: number | string
  maskClosable?: NModalProps['maskClosable']
  zIndex?: NModalProps['zIndex']
  contentClass?: NModalProps['contentClass']
  contentStyle?: NModalProps['contentStyle']
  headerClass?: NModalProps['headerClass']
  headerStyle?: NModalProps['headerStyle']
  footerClass?: NModalProps['footerClass']
  footerStyle?: NModalProps['footerStyle']
  onBeforeOpen?: (mode: NvFormMode) => Promise<void> | void
  onBeforeClose?: (mode: NvFormMode) => Promise<void> | void
  to?: NModalProps['to']
  actionId?: string
}

export interface NvModalProps extends BaseContainerProps {
  fullscreenEnabled?: boolean
  draggable?: NModalProps['draggable']
  transformOrigin?: NModalProps['transformOrigin']
}

export interface NvDrawerProps extends BaseContainerProps {
  placement?: NDrawerProps['placement']
  resizable?: NDrawerProps['resizable']
  minHeight?: NDrawerProps['minHeight']
  maxHeight?: NDrawerProps['maxHeight']
  minWidth?: NDrawerProps['minWidth']
  maxWidth?: NDrawerProps['maxWidth']
}
